package a8;



public class Pile {
	/**
	 * Create a new pile
	 * @param number
	 */
	public Pile(int number) {
		total = number;
	}
	/** 
	 * 
	 * @return Total marbles remaining
	 */
	public int getTotal() {
		if(total < 0)
			total = 0;
		return total;
	}
	/**
	 * 
	 * @param a Amount to be taken
	 * @return Amount left.
	 */
	public int take(int a){
		total -= a;
		return total;
	}

	private int total;
}
